/* eslint-disable */
// 产品信息
import {apiPrefixDispose} from '@/utils/format';
import {request} from '@umijs/max';


/**
 * 分页查询Access
 */
export async function page<T = any>(body: API.CloudAccessKeyPage) {
    return request<API.ResultPageVO<API.CloudAccessKey>>(apiPrefixDispose('/cloud/access/page'), {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
    });
  }


/**
 * 根据ID获取详情
 */
export async function info<T = any>(id: number) {
    return request<API.ResultVO<API.CloudAccessKey>>(apiPrefixDispose(`/cloud/access/${id}`), {
      method: 'GET',
    });
  }


  /**
   * 新增Access
   */
  export async function append<T = any>(
    body: API.CloudAccessKeyAdd,
    options?: { [key: string]: any },
  ) {
    return request<API.ResultVO<string>>(apiPrefixDispose(`/cloud/access/append`), {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    });
  }


/**
 * 删除Access
 */
export async function deleteByAccessId<T = any>(
    accessId: string,
    options?: { [key: string]: any },
  ) {
    return request<API.ResultVO<string>>(apiPrefixDispose(`/cloud/access/delete`), {
      method: 'GET',
      params: { 'accessId':accessId },
      ...(options || {}),
    });
  }


/**
 * 支持的clouds
 */
export async function clouds<T = any>() {
  return request<API.ResultVO<Array<API.CloudEnums>>>(apiPrefixDispose('/cloud/access/clouds'), {
    method: 'GET',
  });
}


/**
 * Access集合
 */
export async function accessKeys<T = any>() {
  return request<API.ResultVO<Array<API.CloudAccessKey>>>(apiPrefixDispose('/cloud/access/lists'), {
    method: 'GET',
  });
}
